package com.situ.student.controller.test;

import java.io.IOException;
import java.util.Arrays;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class GetPostServlet extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		 String name = req.getParameter("name");
		 int age = Integer.parseInt(req.getParameter("age"));
		 String gender = req.getParameter("gender");
		 String[] likes = req.getParameterValues("likes");
		 System.out.println("name： " + name);
		 System.out.println("age： " + age);
		 System.out.println("gender： " + gender);
		 System.out.println(Arrays.toString(likes));
	}
}
